@echo off

echo ++++++++++++++++++++++++++++++++++++++
echo %date:~0% %time:~0,-3%

set yy=%date:~0,4%
set mm=%date:~5,2%
set dd=%date:~8,2%
set h=%time:~0,2%
set m=%time:~3,2%
REM set s=%time:~6,2%

if "%h:~0,1%"==" " set "h=0%h:~1%"

SET n=%yy%-%mm%-%dd%_%h%-%m%

set FolderName=%cd%\Flash\Obj

for /f %%a in ('dir  /od /tc /b %FolderName%\*.hex') do (
	set name=%%~na
    if not !filename! == ""  (
        goto iconv
    )
)

:iconv

set  filename=%name%_%n%
copy Flash\Obj\%name%.hex ..\Hex\%filename%.hex


